
package uia.alumni.data;
/*
 * ID Class for GroupParticipation class. This is necessary to create a composite key.
 * It's possible to avoid all this, but in the sake of design I'll implement it. 
 *
 * @Author: Simon Zimmermann.
 */


import java.io.Serializable;

public class GroupParticipationId  implements Serializable {

    // Declaring Variables.
    private long userId;
    private long groupId;

    // Constructors.
    public GroupParticipationId() {
    }

    public GroupParticipationId(long userId, long groupId) {
        this.userId = userId;
        this.groupId = groupId;
    }

    // Methods.
    @Override
    public boolean equals(Object o) {
        return ((o instanceof GroupParticipationId) &&
                getUserId() == ((GroupParticipationId) o).getUserId()) &&
                getGroupId() == ((GroupParticipationId)o).getGroupId();
    }

    // getters & setters
    public long getUserId() {
        return userId;
    }

    public long getGroupId() {
        return groupId;
    }

}
